import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/layout.vue'
import Index from '@/views/index.vue'
import Search from '@/views/search.vue'
import Ask from '@/views/ask.vue'
import User from '@/views/user.vue'
import Map from '@/views/map.vue'
import City from '@/views/city.vue'
import Login from '@/views/login.vue'
import Register from '@/views/register.vue'
import HouseDetail from '@/views/housedetail.vue'
// import CityList from '@/views/city-list.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    redirect: '/index',
    children: [
      { path: 'index', component: Index },
      { path: 'search', component: Search },
      { path: 'ask', component: Ask },
      { path: 'user', component: User }
    ]
  },
  { path: '/map', component: Map },
  { path: '/city', component: City },
  { path: '/login', component: Login },
  { path: '/register', component: Register },
  { path: '/housedetail', component: HouseDetail }
]

const router = new VueRouter({
  routes
})

export default router
